<template>
  <a-modal
    v-model:open="props.show"
    width="40%"
    centered
    :title="props.title"
    :footer="null"
  >
    <a-form
      ref="formRef"
      class="form"
      :model="formState"
      :rules="rules"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
    >
      <a-form-item ref="name" label="银行卡号" name="name">
        <a-input
          :bordered="false"
          class="h-form-input"
          placeholder="输入收件人姓名"
          v-model:value="formState.name"
        />
      </a-form-item>
      <a-form-item ref="name" label="银行名称" name="code">
        <a-input
          :bordered="false"
          class="h-form-input"
          placeholder="输入联系电话"
          v-model:value="formState.name"
        />
      </a-form-item>
      <a-form-item ref="name" label="开户行名称" name="person">
        <a-input
          :bordered="false"
          class="h-form-input"
          placeholder="选择退货地址"
          v-model:value="formState.name"
        />
      </a-form-item>
      <a-form-item ref="name" label="开户行地址" name="person">
        <a-input
          :bordered="false"
          class="h-form-input"
          placeholder="选择退货地址"
          v-model:value="formState.name"
        />
      </a-form-item>
      <a-form-item ref="name" label="预留手机号" name="person">
        <a-input
          :bordered="false"
          class="h-form-input"
          placeholder="选择退货地址"
          v-model:value="formState.name"
        />
      </a-form-item>
      <a-form-item ref="name" label="验证码" name="person">
        <div class="form-flex">
          <a-input
            :bordered="false"
            class="h-form-lebel h-form-input"
            v-model:value="formState.password"
            placeholder="请输入验证码"
          >
          </a-input>
          <a-button class="h-form-lebel" type="primary">获取验证码</a-button>
        </div>
      </a-form-item>
      <a-form-item :wrapper-col="{ offset: 9, span: 4 }">
        <div class="btns center">
          <a-space>
            <a-button @click="handleCloseDialog">取消</a-button>
            <a-button type="primary" @click="handleSubmit">确定</a-button>
          </a-space>
        </div>
      </a-form-item>
    </a-form>
  </a-modal>
</template>
<script setup>
import { reactive, ref } from "vue";
const props = defineProps(["show", "title"]);
const formRef = ref();
const labelCol = {
  span: 4,
};
const wrapperCol = {
  span: 18,
};
const formState = reactive({
  name: "",
  code: undefined,
  person: undefined,
});
const rules = {
  name: [
    {
      required: true,
      message: "请设置店铺名称",
      trigger: "blur",
    },
  ],
  person: [
    {
      required: true,
      message: "请输入手机号",
      trigger: "blur",
    },
  ],
};
const emits = defineEmits(["handleSave", "handleCancel"]);
const handleSubmit = () => {
  emits("handleSave", true);
};
const handleCloseDialog = () => {
  emits("handleCancel", false);
};
</script>
<style scoped lang="less">
.form {
  margin-top: 24px;
}
.content {
  background: #f4f6f8;
  border-radius: 8px;
  margin-top: 20px;
  min-height: 200px;
  margin-bottom: 40px;
}
.h-form-input {
  background-color: #f3f5f7;
}
.form-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
</style>
